package com.develope.tree.image;

import java.util.ArrayList;

import android.app.Activity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.support.v4.view.ViewPager;
import android.widget.ImageView;

import com.develope.tree.R;
import com.develope.tree.util.SystemUiHider;
import com.develope.tree.utils.Utils;

/**
 * An example full-screen activity that shows and hides the system UI (i.e.
 * status bar and navigation/system bar) with user interaction.
 * 
 * @see SystemUiHider
 */
public class FullscreenViewActivity extends Activity {
		
	private int width,heigh;
	private ArrayList<String> imagePaths = new ArrayList<String>();
	private Utils utils;
	private FullScreenImageAdapter mPagerAdapter;
	private ViewPager mPager;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		setContentView(R.layout.activity_fullscreen_view);

		Intent i =getIntent();
		utils = new Utils(this);
		
		imagePaths = utils.getFilePaths();
		
		Resources r = getResources();
		
		width = r.getDisplayMetrics().widthPixels;
		heigh = r.getDisplayMetrics().heightPixels;
		
//		int position =i.getExtras().getInt("id");
		mPagerAdapter = new FullScreenImageAdapter(this, imagePaths, width, heigh);
		mPager = (ViewPager) findViewById(R.id.pager);
		mPager.setAdapter(mPagerAdapter);
		mPager.setCurrentItem(i.getExtras().getInt("position"));
		
	}
}
